package com.oocl.crm.controller.impl;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.Scanner;

import com.oocl.crm.controller.Controller;
import com.oocl.crm.parser.CmdParser;
import com.oocl.crm.pojo.Customer;
import com.oocl.crm.util.FormatPrinter;

public class ControllerImpl implements Controller{
	private CmdParser parser;

	@Override
	public void commandProcess(InputStream in, OutputStream out) {
		//完成键盘命令输入接收
		Scanner scaner=new Scanner(in);
		String cmd=scaner.next();
		//初步解析，并调用CmdParser
		
		//调用FomartPrinter打印输出
		String action=null;
		switch (action) {
		case "L":
			Customer[] cs= parser.find(cmd);
			FormatPrinter.printCustomers(cs, out);
			break;

		default:
			break;
		}
	}
	
}
